home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / lispref.info-27 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  50.8 KB  |  1,181 lines

  1. This is Info file ../../info/lispref.info, produced by Makeinfo-1.63
  2. from the input file lispref.texi.
  3.  
  4.    Edition History:
  5.  
  6.    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
  7. Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
  8. Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
  9. XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
  10. GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
  11. Programmer's Manual (for 19.13) Third Edition, July 1995
  12.  
  13.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
  14. Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
  15. Copyright (C) 1995 Amdahl Corporation.  Copyright (C) 1995 Ben Wing.
  16.  
  17.    Permission is granted to make and distribute verbatim copies of this
  18. manual provided the copyright notice and this permission notice are
  19. preserved on all copies.
  20.  
  21.    Permission is granted to copy and distribute modified versions of
  22. this manual under the conditions for verbatim copying, provided that the
  23. entire resulting derived work is distributed under the terms of a
  24. permission notice identical to this one.
  25.  
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that this permission notice may be stated in a
  29. translation approved by the Foundation.
  30.  
  31.    Permission is granted to copy and distribute modified versions of
  32. this manual under the conditions for verbatim copying, provided also
  33. that the section entitled "GNU General Public License" is included
  34. exactly as in the original, and provided that the entire resulting
  35. derived work is distributed under the terms of a permission notice
  36. identical to this one.
  37.  
  38.    Permission is granted to copy and distribute translations of this
  39. manual into another language, under the above conditions for modified
  40. versions, except that the section entitled "GNU General Public License"
  41. may be included in a translation approved by the Free Software
  42. Foundation instead of in the original English.
  43.  
  44. 
  45. File: lispref.info,  Node: Sorting,  Next: Columns,  Prev: Auto Filling,  Up: Text
  46.  
  47. Sorting Text
  48. ============
  49.  
  50.    The sorting functions described in this section all rearrange text in
  51. a buffer.  This is in contrast to the function `sort', which rearranges
  52. the order of the elements of a list (*note Rearrangement::.).  The
  53. values returned by these functions are not meaningful.
  54.  
  55.  - Function: sort-subr REVERSE NEXTRECFUN ENDRECFUN &optional
  56.           STARTKEYFUN ENDKEYFUN
  57.      This function is the general text-sorting routine that divides a
  58.      buffer into records and sorts them.  Most of the commands in this
  59.      section use this function.
  60.  
  61.      To understand how `sort-subr' works, consider the whole accessible
  62.      portion of the buffer as being divided into disjoint pieces called
  63.      "sort records".  The records may or may not be contiguous; they may
  64.      not overlap.  A portion of each sort record (perhaps all of it) is
  65.      designated as the sort key.  Sorting rearranges the records in
  66.      order by their sort keys.
  67.  
  68.      Usually, the records are rearranged in order of ascending sort key.
  69.      If the first argument to the `sort-subr' function, REVERSE, is
  70.      non-`nil', the sort records are rearranged in order of descending
  71.      sort key.
  72.  
  73.      The next four arguments to `sort-subr' are functions that are
  74.      called to move point across a sort record.  They are called many
  75.      times from within `sort-subr'.
  76.  
  77.        1. NEXTRECFUN is called with point at the end of a record.  This
  78.           function moves point to the start of the next record.  The
  79.           first record is assumed to start at the position of point
  80.           when `sort-subr' is called.  Therefore, you should usually
  81.           move point to the beginning of the buffer before calling
  82.           `sort-subr'.
  83.  
  84.           This function can indicate there are no more sort records by
  85.           leaving point at the end of the buffer.
  86.  
  87.        2. ENDRECFUN is called with point within a record.  It moves
  88.           point to the end of the record.
  89.  
  90.        3. STARTKEYFUN is called to move point from the start of a
  91.           record to the start of the sort key.  This argument is
  92.           optional; if it is omitted, the whole record is the sort key.
  93.           If supplied, the function should either return a non-`nil'
  94.           value to be used as the sort key, or return `nil' to indicate
  95.           that the sort key is in the buffer starting at point.  In the
  96.           latter case, ENDKEYFUN is called to find the end of the sort
  97.           key.
  98.  
  99.        4. ENDKEYFUN is called to move point from the start of the sort
  100.           key to the end of the sort key.  This argument is optional.
  101.           If STARTKEYFUN returns `nil' and this argument is omitted (or
  102.           `nil'), then the sort key extends to the end of the record.
  103.           There is no need for ENDKEYFUN if STARTKEYFUN returns a
  104.           non-`nil' value.
  105.  
  106.      As an example of `sort-subr', here is the complete function
  107.      definition for `sort-lines':
  108.  
  109.           ;; Note that the first two lines of doc string
  110.           ;; are effectively one line when viewed by a user.
  111.           (defun sort-lines (reverse beg end)
  112.             "Sort lines in region alphabetically.
  113.           Called from a program, there are three arguments:
  114.           REVERSE (non-nil means reverse order),
  115.           and BEG and END (the region to sort)."
  116.             (interactive "P\nr")
  117.             (save-restriction
  118.               (narrow-to-region beg end)
  119.               (goto-char (point-min))
  120.               (sort-subr reverse
  121.                          'forward-line
  122.                          'end-of-line)))
  123.  
  124.      Here `forward-line' moves point to the start of the next record,
  125.      and `end-of-line' moves point to the end of record.  We do not pass
  126.      the arguments STARTKEYFUN and ENDKEYFUN, because the entire record
  127.      is used as the sort key.
  128.  
  129.      The `sort-paragraphs' function is very much the same, except that
  130.      its `sort-subr' call looks like this:
  131.  
  132.           (sort-subr reverse
  133.                      (function
  134.                       (lambda ()
  135.                         (skip-chars-forward "\n \t\f")))
  136.                      'forward-paragraph)
  137.  
  138.  - Command: sort-regexp-fields REVERSE RECORD-REGEXP KEY-REGEXP START
  139.           END
  140.      This command sorts the region between START and END alphabetically
  141.      as specified by RECORD-REGEXP and KEY-REGEXP.  If REVERSE is a
  142.      negative integer, then sorting is in reverse order.
  143.  
  144.      Alphabetical sorting means that two sort keys are compared by
  145.      comparing the first characters of each, the second characters of
  146.      each, and so on.  If a mismatch is found, it means that the sort
  147.      keys are unequal; the sort key whose character is less at the
  148.      point of first mismatch is the lesser sort key.  The individual
  149.      characters are compared according to their numerical values.
  150.      Since Emacs uses the ASCII character set, the ordering in that set
  151.      determines alphabetical order.
  152.  
  153.      The value of the RECORD-REGEXP argument specifies how to divide
  154.      the buffer into sort records.  At the end of each record, a search
  155.      is done for this regular expression, and the text that matches it
  156.      is the next record.  For example, the regular expression `^.+$',
  157.      which matches lines with at least one character besides a newline,
  158.      would make each such line into a sort record.  *Note Regular
  159.      Expressions::, for a description of the syntax and meaning of
  160.      regular expressions.
  161.  
  162.      The value of the KEY-REGEXP argument specifies what part of each
  163.      record is the sort key.  The KEY-REGEXP could match the whole
  164.      record, or only a part.  In the latter case, the rest of the
  165.      record has no effect on the sorted order of records, but it is
  166.      carried along when the record moves to its new position.
  167.  
  168.      The KEY-REGEXP argument can refer to the text matched by a
  169.      subexpression of RECORD-REGEXP, or it can be a regular expression
  170.      on its own.
  171.  
  172.      If KEY-REGEXP is:
  173.  
  174.     `\DIGIT'
  175.           then the text matched by the DIGITth `\(...\)' parenthesis
  176.           grouping in RECORD-REGEXP is the sort key.
  177.  
  178.     `\&'
  179.           then the whole record is the sort key.
  180.  
  181.     a regular expression
  182.           then `sort-regexp-fields' searches for a match for the regular
  183.           expression within the record.  If such a match is found, it
  184.           is the sort key.  If there is no match for KEY-REGEXP within
  185.           a record then that record is ignored, which means its
  186.           position in the buffer is not changed.  (The other records
  187.           may move around it.)
  188.  
  189.      For example, if you plan to sort all the lines in the region by the
  190.      first word on each line starting with the letter `f', you should
  191.      set RECORD-REGEXP to `^.*$' and set KEY-REGEXP to `\<f\w*\>'.  The
  192.      resulting expression looks like this:
  193.  
  194.           (sort-regexp-fields nil "^.*$" "\\<f\\w*\\>"
  195.                               (region-beginning)
  196.                               (region-end))
  197.  
  198.      If you call `sort-regexp-fields' interactively, it prompts for
  199.      RECORD-REGEXP and KEY-REGEXP in the minibuffer.
  200.  
  201.  - Command: sort-lines REVERSE START END
  202.      This command alphabetically sorts lines in the region between
  203.      START and END.  If REVERSE is non-`nil', the sort is in reverse
  204.      order.
  205.  
  206.  - Command: sort-paragraphs REVERSE START END
  207.      This command alphabetically sorts paragraphs in the region between
  208.      START and END.  If REVERSE is non-`nil', the sort is in reverse
  209.      order.
  210.  
  211.  - Command: sort-pages REVERSE START END
  212.      This command alphabetically sorts pages in the region between
  213.      START and END.  If REVERSE is non-`nil', the sort is in reverse
  214.      order.
  215.  
  216.  - Command: sort-fields FIELD START END
  217.      This command sorts lines in the region between START and END,
  218.      comparing them alphabetically by the FIELDth field of each line.
  219.      Fields are separated by whitespace and numbered starting from 1.
  220.      If FIELD is negative, sorting is by the -FIELDth field from the
  221.      end of the line.  This command is useful for sorting tables.
  222.  
  223.  - Command: sort-numeric-fields FIELD START END
  224.      This command sorts lines in the region between START and END,
  225.      comparing them numerically by the FIELDth field of each line.  The
  226.      specified field must contain a number in each line of the region.
  227.      Fields are separated by whitespace and numbered starting from 1.
  228.      If FIELD is negative, sorting is by the -FIELDth field from the
  229.      end of the line.  This command is useful for sorting tables.
  230.  
  231.  - Command: sort-columns REVERSE &optional BEG END
  232.      This command sorts the lines in the region between BEG and END,
  233.      comparing them alphabetically by a certain range of columns.  The
  234.      column positions of BEG and END bound the range of columns to sort
  235.      on.
  236.  
  237.      If REVERSE is non-`nil', the sort is in reverse order.
  238.  
  239.      One unusual thing about this command is that the entire line
  240.      containing position BEG, and the entire line containing position
  241.      END, are included in the region sorted.
  242.  
  243.      Note that `sort-columns' uses the `sort' utility program, and so
  244.      cannot work properly on text containing tab characters.  Use `M-x
  245.      `untabify'' to convert tabs to spaces before sorting.
  246.  
  247. 
  248. File: lispref.info,  Node: Columns,  Next: Indentation,  Prev: Sorting,  Up: Text
  249.  
  250. Counting Columns
  251. ================
  252.  
  253.    The column functions convert between a character position (counting
  254. characters from the beginning of the buffer) and a column position
  255. (counting screen characters from the beginning of a line).
  256.  
  257.    A character counts according to the number of columns it occupies on
  258. the screen.  This means control characters count as occupying 2 or 4
  259. columns, depending upon the value of `ctl-arrow', and tabs count as
  260. occupying a number of columns that depends on the value of `tab-width'
  261. and on the column where the tab begins.  *Note Usual Display::.
  262.  
  263.    Column number computations ignore the width of the window and the
  264. amount of horizontal scrolling.  Consequently, a column value can be
  265. arbitrarily high.  The first (or leftmost) column is numbered 0.
  266.  
  267.  - Function: current-column
  268.      This function returns the horizontal position of point, measured in
  269.      columns, counting from 0 at the left margin.  The column position
  270.      is the sum of the widths of all the displayed representations of
  271.      the characters between the start of the current line and point.
  272.  
  273.      For an example of using `current-column', see the description of
  274.      `count-lines' in *Note Text Lines::.
  275.  
  276.  - Function: move-to-column COLUMN &optional FORCE
  277.      This function moves point to COLUMN in the current line.  The
  278.      calculation of COLUMN takes into account the widths of the
  279.      displayed representations of the characters between the start of
  280.      the line and point.
  281.  
  282.      If column COLUMN is beyond the end of the line, point moves to the
  283.      end of the line.  If COLUMN is negative, point moves to the
  284.      beginning of the line.
  285.  
  286.      If it is impossible to move to column COLUMN because that is in
  287.      the middle of a multicolumn character such as a tab, point moves
  288.      to the end of that character.  However, if FORCE is non-`nil', and
  289.      COLUMN is in the middle of a tab, then `move-to-column' converts
  290.      the tab into spaces so that it can move precisely to column
  291.      COLUMN.  Other multicolumn characters can cause anomalies despite
  292.      FORCE, since there is no way to split them.
  293.  
  294.      The argument FORCE also has an effect if the line isn't long
  295.      enough to reach column COLUMN; in that case, it says to add
  296.      whitespace at the end of the line to reach that column.
  297.  
  298.      If COLUMN is not an integer, an error is signaled.
  299.  
  300.      The return value is the column number actually moved to.
  301.  
  302. 
  303. File: lispref.info,  Node: Indentation,  Next: Case Changes,  Prev: Columns,  Up: Text
  304.  
  305. Indentation
  306. ===========
  307.  
  308.    The indentation functions are used to examine, move to, and change
  309. whitespace that is at the beginning of a line.  Some of the functions
  310. can also change whitespace elsewhere on a line.  Columns and indentation
  311. count from zero at the left margin.
  312.  
  313. * Menu:
  314.  
  315. * Primitive Indent::      Functions used to count and insert indentation.
  316. * Mode-Specific Indent::  Customize indentation for different modes.
  317. * Region Indent::         Indent all the lines in a region.
  318. * Relative Indent::       Indent the current line based on previous lines.
  319. * Indent Tabs::           Adjustable, typewriter-like tab stops.
  320. * Motion by Indent::      Move to first non-blank character.
  321.  
  322. 
  323. File: lispref.info,  Node: Primitive Indent,  Next: Mode-Specific Indent,  Up: Indentation
  324.  
  325. Indentation Primitives
  326. ----------------------
  327.  
  328.    This section describes the primitive functions used to count and
  329. insert indentation.  The functions in the following sections use these
  330. primitives.
  331.  
  332.  - Function: current-indentation
  333.      This function returns the indentation of the current line, which is
  334.      the horizontal position of the first nonblank character.  If the
  335.      contents are entirely blank, then this is the horizontal position
  336.      of the end of the line.
  337.  
  338.  - Command: indent-to COLUMN &optional MINIMUM
  339.      This function indents from point with tabs and spaces until COLUMN
  340.      is reached.  If MINIMUM is specified and non-`nil', then at least
  341.      that many spaces are inserted even if this requires going beyond
  342.      COLUMN.  Otherwise the function does nothing if point is already
  343.      beyond COLUMN.  The value is the column at which the inserted
  344.      indentation ends.
  345.  
  346.  - User Option: indent-tabs-mode
  347.      If this variable is non-`nil', indentation functions can insert
  348.      tabs as well as spaces.  Otherwise, they insert only spaces.
  349.      Setting this variable automatically makes it local to the current
  350.      buffer.
  351.  
  352. 
  353. File: lispref.info,  Node: Mode-Specific Indent,  Next: Region Indent,  Prev: Primitive Indent,  Up: Indentation
  354.  
  355. Indentation Controlled by Major Mode
  356. ------------------------------------
  357.  
  358.    An important function of each major mode is to customize the TAB key
  359. to indent properly for the language being edited.  This section
  360. describes the mechanism of the TAB key and how to control it.  The
  361. functions in this section return unpredictable values.
  362.  
  363.  - Variable: indent-line-function
  364.      This variable's value is the function to be used by TAB (and
  365.      various commands) to indent the current line.  The command
  366.      `indent-according-to-mode' does no more than call this function.
  367.  
  368.      In Lisp mode, the value is the symbol `lisp-indent-line'; in C
  369.      mode, `c-indent-line'; in Fortran mode, `fortran-indent-line'.  In
  370.      Fundamental mode, Text mode, and many other modes with no standard
  371.      for indentation, the value is `indent-to-left-margin' (which is the
  372.      default value).
  373.  
  374.  - Command: indent-according-to-mode
  375.      This command calls the function in `indent-line-function' to
  376.      indent the current line in a way appropriate for the current major
  377.      mode.
  378.  
  379.  - Command: indent-for-tab-command
  380.      This command calls the function in `indent-line-function' to indent
  381.      the current line; except that if that function is
  382.      `indent-to-left-margin', it calls `insert-tab' instead.  (That is
  383.      a trivial command that inserts a tab character.)
  384.  
  385.  - Command: newline-and-indent
  386.      This function inserts a newline, then indents the new line (the one
  387.      following the newline just inserted) according to the major mode.
  388.  
  389.      It does indentation by calling the current `indent-line-function'.
  390.      In programming language modes, this is the same thing TAB does,
  391.      but in some text modes, where TAB inserts a tab,
  392.      `newline-and-indent' indents to the column specified by
  393.      `left-margin'.
  394.  
  395.  - Command: reindent-then-newline-and-indent
  396.      This command reindents the current line, inserts a newline at
  397.      point, and then reindents the new line (the one following the
  398.      newline just inserted).
  399.  
  400.      This command does indentation on both lines according to the
  401.      current major mode, by calling the current value of
  402.      `indent-line-function'.  In programming language modes, this is
  403.      the same thing TAB does, but in some text modes, where TAB inserts
  404.      a tab, `reindent-then-newline-and-indent' indents to the column
  405.      specified by `left-margin'.
  406.  
  407. 
  408. File: lispref.info,  Node: Region Indent,  Next: Relative Indent,  Prev: Mode-Specific Indent,  Up: Indentation
  409.  
  410. Indenting an Entire Region
  411. --------------------------
  412.  
  413.    This section describes commands that indent all the lines in the
  414. region.  They return unpredictable values.
  415.  
  416.  - Command: indent-region START END TO-COLUMN
  417.      This command indents each nonblank line starting between START
  418.      (inclusive) and END (exclusive).  If TO-COLUMN is `nil',
  419.      `indent-region' indents each nonblank line by calling the current
  420.      mode's indentation function, the value of `indent-line-function'.
  421.  
  422.      If TO-COLUMN is non-`nil', it should be an integer specifying the
  423.      number of columns of indentation; then this function gives each
  424.      line exactly that much indentation, by either adding or deleting
  425.      whitespace.
  426.  
  427.      If there is a fill prefix, `indent-region' indents each line by
  428.      making it start with the fill prefix.
  429.  
  430.  - Variable: indent-region-function
  431.      The value of this variable is a function that can be used by
  432.      `indent-region' as a short cut.  You should design the function so
  433.      that it will produce the same results as indenting the lines of the
  434.      region one by one, but presumably faster.
  435.  
  436.      If the value is `nil', there is no short cut, and `indent-region'
  437.      actually works line by line.
  438.  
  439.      A short-cut function is useful in modes such as C mode and Lisp
  440.      mode, where the `indent-line-function' must scan from the
  441.      beginning of the function definition: applying it to each line
  442.      would be quadratic in time.  The short cut can update the scan
  443.      information as it moves through the lines indenting them; this
  444.      takes linear time.  In a mode where indenting a line individually
  445.      is fast, there is no need for a short cut.
  446.  
  447.      `indent-region' with a non-`nil' argument TO-COLUMN has a
  448.      different meaning and does not use this variable.
  449.  
  450.  - Command: indent-rigidly START END COUNT
  451.      This command indents all lines starting between START (inclusive)
  452.      and END (exclusive) sideways by COUNT columns.  This "preserves
  453.      the shape" of the affected region, moving it as a rigid unit.
  454.      Consequently, this command is useful not only for indenting
  455.      regions of unindented text, but also for indenting regions of
  456.      formatted code.
  457.  
  458.      For example, if COUNT is 3, this command adds 3 columns of
  459.      indentation to each of the lines beginning in the region specified.
  460.  
  461.      In Mail mode, `C-c C-y' (`mail-yank-original') uses
  462.      `indent-rigidly' to indent the text copied from the message being
  463.      replied to.
  464.  
  465.  - Function: indent-code-rigidly START END COLUMNS &optional
  466.           NOCHANGE-REGEXP
  467.      This is like `indent-rigidly', except that it doesn't alter lines
  468.      that start within strings or comments.
  469.  
  470.      In addition, it doesn't alter a line if NOCHANGE-REGEXP matches at
  471.      the beginning of the line (if NOCHANGE-REGEXP is non-`nil').
  472.  
  473. 
  474. File: lispref.info,  Node: Relative Indent,  Next: Indent Tabs,  Prev: Region Indent,  Up: Indentation
  475.  
  476. Indentation Relative to Previous Lines
  477. --------------------------------------
  478.  
  479.    This section describes two commands that indent the current line
  480. based on the contents of previous lines.
  481.  
  482.  - Command: indent-relative &optional UNINDENTED-OK
  483.      This command inserts whitespace at point, extending to the same
  484.      column as the next "indent point" of the previous nonblank line.
  485.      An indent point is a non-whitespace character following
  486.      whitespace.  The next indent point is the first one at a column
  487.      greater than the current column of point.  For example, if point
  488.      is underneath and to the left of the first non-blank character of
  489.      a line of text, it moves to that column by inserting whitespace.
  490.  
  491.      If the previous nonblank line has no next indent point (i.e., none
  492.      at a great enough column position), `indent-relative' either does
  493.      nothing (if UNINDENTED-OK is non-`nil') or calls
  494.      `tab-to-tab-stop'.  Thus, if point is underneath and to the right
  495.      of the last column of a short line of text, this command ordinarily
  496.      moves point to the next tab stop by inserting whitespace.
  497.  
  498.      The return value of `indent-relative' is unpredictable.
  499.  
  500.      In the following example, point is at the beginning of the second
  501.      line:
  502.  
  503.                       This line is indented twelve spaces.
  504.           -!-The quick brown fox jumped.
  505.  
  506.      Evaluation of the expression `(indent-relative nil)' produces the
  507.      following:
  508.  
  509.                       This line is indented twelve spaces.
  510.                       -!-The quick brown fox jumped.
  511.  
  512.      In this example, point is between the `m' and `p' of `jumped':
  513.  
  514.                       This line is indented twelve spaces.
  515.           The quick brown fox jum-!-ped.
  516.  
  517.      Evaluation of the expression `(indent-relative nil)' produces the
  518.      following:
  519.  
  520.                       This line is indented twelve spaces.
  521.           The quick brown fox jum  -!-ped.
  522.  
  523.  - Command: indent-relative-maybe
  524.      This command indents the current line like the previous nonblank
  525.      line.  It calls `indent-relative' with `t' as the UNINDENTED-OK
  526.      argument.  The return value is unpredictable.
  527.  
  528.      If the previous nonblank line has no indent points beyond the
  529.      current column, this command does nothing.
  530.  
  531. 
  532. File: lispref.info,  Node: Indent Tabs,  Next: Motion by Indent,  Prev: Relative Indent,  Up: Indentation
  533.  
  534. Adjustable "Tab Stops"
  535. ----------------------
  536.  
  537.    This section explains the mechanism for user-specified "tab stops"
  538. and the mechanisms that use and set them.  The name "tab stops" is used
  539. because the feature is similar to that of the tab stops on a
  540. typewriter.  The feature works by inserting an appropriate number of
  541. spaces and tab characters to reach the next tab stop column; it does not
  542. affect the display of tab characters in the buffer (*note Usual
  543. Display::.).  Note that the TAB character as input uses this tab stop
  544. feature only in a few major modes, such as Text mode.
  545.  
  546.  - Command: tab-to-tab-stop
  547.      This command inserts spaces or tabs up to the next tab stop column
  548.      defined by `tab-stop-list'.  It searches the list for an element
  549.      greater than the current column number, and uses that element as
  550.      the column to indent to.  It does nothing if no such element is
  551.      found.
  552.  
  553.  - User Option: tab-stop-list
  554.      This variable is the list of tab stop columns used by
  555.      `tab-to-tab-stops'.  The elements should be integers in increasing
  556.      order.  The tab stop columns need not be evenly spaced.
  557.  
  558.      Use `M-x edit-tab-stops' to edit the location of tab stops
  559.      interactively.
  560.  
  561. 
  562. File: lispref.info,  Node: Motion by Indent,  Prev: Indent Tabs,  Up: Indentation
  563.  
  564. Indentation-Based Motion Commands
  565. ---------------------------------
  566.  
  567.    These commands, primarily for interactive use, act based on the
  568. indentation in the text.
  569.  
  570.  - Command: back-to-indentation
  571.      This command moves point to the first non-whitespace character in
  572.      the current line (which is the line in which point is located).
  573.      It returns `nil'.
  574.  
  575.  - Command: backward-to-indentation ARG
  576.      This command moves point backward ARG lines and then to the first
  577.      nonblank character on that line.  It returns `nil'.
  578.  
  579.  - Command: forward-to-indentation ARG
  580.      This command moves point forward ARG lines and then to the first
  581.      nonblank character on that line.  It returns `nil'.
  582.  
  583. 
  584. File: lispref.info,  Node: Case Changes,  Next: Text Properties,  Prev: Indentation,  Up: Text
  585.  
  586. Case Changes
  587. ============
  588.  
  589.    The case change commands described here work on text in the current
  590. buffer.  *Note Character Case::, for case conversion commands that work
  591. on strings and characters.  *Note Case Table::, for how to customize
  592. which characters are upper or lower case and how to convert them.
  593.  
  594.  - Command: capitalize-region START END
  595.      This function capitalizes all words in the region defined by START
  596.      and END.  To capitalize means to convert each word's first
  597.      character to upper case and convert the rest of each word to lower
  598.      case.  The function returns `nil'.
  599.  
  600.      If one end of the region is in the middle of a word, the part of
  601.      the word within the region is treated as an entire word.
  602.  
  603.      When `capitalize-region' is called interactively, START and END
  604.      are point and the mark, with the smallest first.
  605.  
  606.           ---------- Buffer: foo ----------
  607.           This is the contents of the 5th foo.
  608.           ---------- Buffer: foo ----------
  609.           
  610.           (capitalize-region 1 44)
  611.           => nil
  612.           
  613.           ---------- Buffer: foo ----------
  614.           This Is The Contents Of The 5th Foo.
  615.           ---------- Buffer: foo ----------
  616.  
  617.  - Command: downcase-region START END
  618.      This function converts all of the letters in the region defined by
  619.      START and END to lower case.  The function returns `nil'.
  620.  
  621.      When `downcase-region' is called interactively, START and END are
  622.      point and the mark, with the smallest first.
  623.  
  624.  - Command: upcase-region START END
  625.      This function converts all of the letters in the region defined by
  626.      START and END to upper case.  The function returns `nil'.
  627.  
  628.      When `upcase-region' is called interactively, START and END are
  629.      point and the mark, with the smallest first.
  630.  
  631.  - Command: capitalize-word COUNT
  632.      This function capitalizes COUNT words after point, moving point
  633.      over as it does.  To capitalize means to convert each word's first
  634.      character to upper case and convert the rest of each word to lower
  635.      case.  If COUNT is negative, the function capitalizes the -COUNT
  636.      previous words but does not move point.  The value is `nil'.
  637.  
  638.      If point is in the middle of a word, the part of the word before
  639.      point is ignored when moving forward.  The rest is treated as an
  640.      entire word.
  641.  
  642.      When `capitalize-word' is called interactively, COUNT is set to
  643.      the numeric prefix argument.
  644.  
  645.  - Command: downcase-word COUNT
  646.      This function converts the COUNT words after point to all lower
  647.      case, moving point over as it does.  If COUNT is negative, it
  648.      converts the -COUNT previous words but does not move point.  The
  649.      value is `nil'.
  650.  
  651.      When `downcase-word' is called interactively, COUNT is set to the
  652.      numeric prefix argument.
  653.  
  654.  - Command: upcase-word COUNT
  655.      This function converts the COUNT words after point to all upper
  656.      case, moving point over as it does.  If COUNT is negative, it
  657.      converts the -COUNT previous words but does not move point.  The
  658.      value is `nil'.
  659.  
  660.      When `upcase-word' is called interactively, COUNT is set to the
  661.      numeric prefix argument.
  662.  
  663. 
  664. File: lispref.info,  Node: Text Properties,  Next: Substitution,  Prev: Case Changes,  Up: Text
  665.  
  666. Text Properties
  667. ===============
  668.  
  669.    Text properties are an alternative interface to extents (*note
  670. Extents::.), and are built on top of them.  They are useful when you
  671. want to view textual properties as being attached to the characters
  672. themselves rather than to intervals of characters.  The text property
  673. interface is compatible with FSF Emacs.
  674.  
  675.    Each character position in a buffer or a string (however, text
  676. properties over strings are not yet implemented in XEmacs) can have a
  677. "text property list", much like the property list of a symbol (*note
  678. Property Lists::.).  The properties belong to a particular character at
  679. a particular place, such as, the letter `T' at the beginning of this
  680. sentence or the first `o' in `foo'--if the same character occurs in two
  681. different places, the two occurrences generally have different
  682. properties.
  683.  
  684.    Each property has a name and a value.  Both of these can be any Lisp
  685. object, but the name is normally a symbol.  The usual way to access the
  686. property list is to specify a name and ask what value corresponds to it.
  687.  
  688.    If a character has a `category' property, we call it the "category"
  689. of the character.  It should be a symbol.  The properties of the symbol
  690. serve as defaults for the properties of the character.
  691.  
  692.    Copying text between strings and buffers preserves the properties
  693. along with the characters; this includes such diverse functions as
  694. `substring', `insert', and `buffer-substring'.
  695.  
  696. * Menu:
  697.  
  698. * Examining Properties::    Looking at the properties of one character.
  699. * Changing Properties::        Setting the properties of a range of text.
  700. * Property Search::        Searching for where a property changes value.
  701. * Special Properties::        Particular properties with special meanings.
  702. * Saving Properties::           Saving text properties in files, and reading
  703.                                   them back.
  704.  
  705. 
  706. File: lispref.info,  Node: Examining Properties,  Next: Changing Properties,  Up: Text Properties
  707.  
  708. Examining Text Properties
  709. -------------------------
  710.  
  711.    The simplest way to examine text properties is to ask for the value
  712. of a particular property of a particular character.  For that, use
  713. `get-text-property'.  Use `text-properties-at' to get the entire
  714. property list of a character.  *Note Property Search::, for functions
  715. to examine the properties of a number of characters at once.
  716.  
  717.    Under FSF Emacs, these functions handle both strings and buffers.
  718. (Keep in mind that positions in a string start from 0, whereas positions
  719. in a buffer start from 1.) Under XEmacs, these functions currently only
  720. handle buffers.  This may change in the future.
  721.  
  722.  - Function: get-text-property POS PROP &optional OBJECT
  723.      This function returns the value of the PROP property of the
  724.      character after position POS in OBJECT (a buffer).  The argument
  725.      OBJECT is optional and defaults to the current buffer.
  726.  
  727.      If there is no PROP property strictly speaking, but the character
  728.      has a category that is a symbol, then `get-text-property' returns
  729.      the PROP property of that symbol.
  730.  
  731.  - Function: text-properties-at POSITION &optional OBJECT
  732.      This function returns the entire property list of the character at
  733.      POSITION in the string or buffer OBJECT.  If OBJECT is `nil', it
  734.      defaults to the current buffer.
  735.  
  736.  - Variable: default-text-properties
  737.      This variable holds a property list giving default values for text
  738.      properties.  Whenever a character does not specify a value for a
  739.      property, neither directly nor through a category symbol, the value
  740.      stored in this list is used instead.  Here is an example:
  741.  
  742.           (setq default-text-properties '(foo 69))
  743.           ;; Make sure character 1 has no properties of its own.
  744.           (set-text-properties 1 2 nil)
  745.           ;; What we get, when we ask, is the default value.
  746.           (get-text-property 1 'foo)
  747.                => 69
  748.  
  749. 
  750. File: lispref.info,  Node: Changing Properties,  Next: Property Search,  Prev: Examining Properties,  Up: Text Properties
  751.  
  752. Changing Text Properties
  753. ------------------------
  754.  
  755.    The primitives for changing properties apply to a specified range of
  756. text.  The function `set-text-properties' (see end of section) sets the
  757. entire property list of the text in that range; more often, it is
  758. useful to add, change, or delete just certain properties specified by
  759. name.
  760.  
  761.    Since text properties are considered part of the buffer's contents,
  762. and can affect how the buffer looks on the screen, any change in the
  763. text properties is considered a buffer modification.  Buffer text
  764. property changes are undoable (*note Undo::.).
  765.  
  766.  - Function: put-text-property START END PROP VALUE &optional OBJECT
  767.      This function sets the PROP property to VALUE for the text between
  768.      START and END in the string or buffer OBJECT.  If OBJECT is `nil',
  769.      it defaults to the current buffer.
  770.  
  771.  - Function: add-text-properties START END PROPS &optional OBJECT
  772.      This function modifies the text properties for the text between
  773.      START and END in the string or buffer OBJECT.  If OBJECT is `nil',
  774.      it defaults to the current buffer.
  775.  
  776.      The argument PROPS specifies which properties to change.  It
  777.      should have the form of a property list (*note Property Lists::.):
  778.      a list whose elements include the property names followed
  779.      alternately by the corresponding values.
  780.  
  781.      The return value is `t' if the function actually changed some
  782.      property's value; `nil' otherwise (if PROPS is `nil' or its values
  783.      agree with those in the text).
  784.  
  785.      For example, here is how to set the `comment' and `face'
  786.      properties of a range of text:
  787.  
  788.           (add-text-properties START END
  789.                                '(comment t face highlight))
  790.  
  791.  - Function: remove-text-properties START END PROPS &optional OBJECT
  792.      This function deletes specified text properties from the text
  793.      between START and END in the buffer OBJECT.  If OBJECT is `nil',
  794.      it defaults to the current buffer.
  795.  
  796.      The argument PROPS specifies which properties to delete.  It
  797.      should have the form of a property list (*note Property Lists::.):
  798.      a list whose elements are property names alternating with
  799.      corresponding values.  But only the names matter--the values that
  800.      accompany them are ignored.  For example, here's how to remove the
  801.      `face' property.
  802.  
  803.           (remove-text-properties START END '(face nil))
  804.  
  805.      The return value is `t' if the function actually changed some
  806.      property's value; `nil' otherwise (if PROPS is `nil' or if no
  807.      character in the specified text had any of those properties).
  808.  
  809.  - Function: set-text-properties START END PROPS &optional OBJECT
  810.      This function completely replaces the text property list for the
  811.      text between START and END in the buffer OBJECT.  If OBJECT is
  812.      `nil', it defaults to the current buffer.
  813.  
  814.      The argument PROPS is the new property list.  It should be a list
  815.      whose elements are property names alternating with corresponding
  816.      values.
  817.  
  818.      After `set-text-properties' returns, all the characters in the
  819.      specified range have identical properties.
  820.  
  821.      If PROPS is `nil', the effect is to get rid of all properties from
  822.      the specified range of text.  Here's an example:
  823.  
  824.           (set-text-properties START END nil)
  825.  
  826.    See also the function `buffer-substring-without-properties' (*note
  827. Buffer Contents::.) which copies text from the buffer but does not copy
  828. its properties.
  829.  
  830. 
  831. File: lispref.info,  Node: Property Search,  Next: Special Properties,  Prev: Changing Properties,  Up: Text Properties
  832.  
  833. Property Search Functions
  834. -------------------------
  835.  
  836.    In typical use of text properties, most of the time several or many
  837. consecutive characters have the same value for a property.  Rather than
  838. writing your programs to examine characters one by one, it is much
  839. faster to process chunks of text that have the same property value.
  840.  
  841.    Here are functions you can use to do this.  They use `eq' for
  842. comparing property values.  In all cases, OBJECT defaults to the
  843. current buffer.
  844.  
  845.    For high performance, it's very important to use the LIMIT argument
  846. to these functions, especially the ones that search for a single
  847. property--otherwise, they may spend a long time scanning to the end of
  848. the buffer, if the property you are interested in does not change.
  849.  
  850.    Remember that a position is always between two characters; the
  851. position returned by these functions is between two characters with
  852. different properties.
  853.  
  854.  - Function: next-property-change POS &optional OBJECT LIMIT
  855.      The function scans the text forward from position POS in the
  856.      string or buffer OBJECT till it finds a change in some text
  857.      property, then returns the position of the change.  In other
  858.      words, it returns the position of the first character beyond POS
  859.      whose properties are not identical to those of the character just
  860.      after POS.
  861.  
  862.      If LIMIT is non-`nil', then the scan ends at position LIMIT.  If
  863.      there is no property change before that point,
  864.      `next-property-change' returns LIMIT.
  865.  
  866.      The value is `nil' if the properties remain unchanged all the way
  867.      to the end of OBJECT and LIMIT is `nil'.  If the value is
  868.      non-`nil', it is a position greater than or equal to POS.  The
  869.      value equals POS only when LIMIT equals POS.
  870.  
  871.      Here is an example of how to scan the buffer by chunks of text
  872.      within which all properties are constant:
  873.  
  874.           (while (not (eobp))
  875.             (let ((plist (text-properties-at (point)))
  876.                   (next-change
  877.                    (or (next-property-change (point) (current-buffer))
  878.                        (point-max))))
  879.               Process text from point to NEXT-CHANGE...
  880.               (goto-char next-change)))
  881.  
  882.  - Function: next-single-property-change POS PROP &optional OBJECT LIMIT
  883.      The function scans the text forward from position POS in the
  884.      buffer OBJECT till it finds a change in the PROP property, then
  885.      returns the position of the change.  In other words, it returns the
  886.      position of the first character beyond POS whose PROP property
  887.      differs from that of the character just after POS.
  888.  
  889.      If LIMIT is non-`nil', then the scan ends at position LIMIT.  If
  890.      there is no property change before that point,
  891.      `next-single-property-change' returns LIMIT.
  892.  
  893.      The value is `nil' if the property remains unchanged all the way to
  894.      the end of OBJECT and LIMIT is `nil'.  If the value is non-`nil',
  895.      it is a position greater than or equal to POS; it equals POS only
  896.      if LIMIT equals POS.
  897.  
  898.  - Function: previous-property-change POS &optional OBJECT LIMIT
  899.      This is like `next-property-change', but scans back from POS
  900.      instead of forward.  If the value is non-`nil', it is a position
  901.      less than or equal to POS; it equals POS only if LIMIT equals POS.
  902.  
  903.  - Function: previous-single-property-change POS PROP &optional OBJECT
  904.           LIMIT
  905.      This is like `next-single-property-change', but scans back from
  906.      POS instead of forward.  If the value is non-`nil', it is a
  907.      position less than or equal to POS; it equals POS only if LIMIT
  908.      equals POS.
  909.  
  910.  - Function: text-property-any START END PROP VALUE &optional OBJECT
  911.      This function returns non-`nil' if at least one character between
  912.      START and END has a property PROP whose value is VALUE.  More
  913.      precisely, it returns the position of the first such character.
  914.      Otherwise, it returns `nil'.
  915.  
  916.      The optional fifth argument, OBJECT, specifies the string or
  917.      buffer to scan.  Positions are relative to OBJECT.  The default
  918.      for OBJECT is the current buffer.
  919.  
  920.  - Function: text-property-not-all START END PROP VALUE &optional OBJECT
  921.      This function returns non-`nil' if at least one character between
  922.      START and END has a property PROP whose value differs from VALUE.
  923.      More precisely, it returns the position of the first such
  924.      character.  Otherwise, it returns `nil'.
  925.  
  926.      The optional fifth argument, OBJECT, specifies the string or
  927.      buffer to scan.  Positions are relative to OBJECT.  The default
  928.      for OBJECT is the current buffer.
  929.  
  930. 
  931. File: lispref.info,  Node: Special Properties,  Next: Saving Properties,  Prev: Property Search,  Up: Text Properties
  932.  
  933. Properties with Special Meanings
  934. --------------------------------
  935.  
  936.    The predefined properties are the same as those for extents.  *Note
  937. Extent Properties::.
  938.  
  939. 
  940. File: lispref.info,  Node: Saving Properties,  Prev: Special Properties,  Up: Text Properties
  941.  
  942. Saving Text Properties in Files
  943. -------------------------------
  944.  
  945.    You can save text properties in files, and restore text properties
  946. when inserting the files, using these two hooks:
  947.  
  948.  - Variable: write-region-annotate-functions
  949.      This variable's value is a list of functions for `write-region' to
  950.      run to encode text properties in some fashion as annotations to
  951.      the text being written in the file.  *Note Writing to Files::.
  952.  
  953.      Each function in the list is called with two arguments: the start
  954.      and end of the region to be written.  These functions should not
  955.      alter the contents of the buffer.  Instead, they should return
  956.      lists indicating annotations to write in the file in addition to
  957.      the text in the buffer.
  958.  
  959.      Each function should return a list of elements of the form
  960.      `(POSITION . STRING)', where POSITION is an integer specifying the
  961.      relative position in the text to be written, and STRING is the
  962.      annotation to add there.
  963.  
  964.      Each list returned by one of these functions must be already
  965.      sorted in increasing order by POSITION.  If there is more than one
  966.      function, `write-region' merges the lists destructively into one
  967.      sorted list.
  968.  
  969.      When `write-region' actually writes the text from the buffer to the
  970.      file, it intermixes the specified annotations at the corresponding
  971.      positions.  All this takes place without modifying the buffer.
  972.  
  973.  - Variable: after-insert-file-functions
  974.      This variable holds a list of functions for `insert-file-contents'
  975.      to call after inserting a file's contents.  These functions should
  976.      scan the inserted text for annotations, and convert them to the
  977.      text properties they stand for.
  978.  
  979.      Each function receives one argument, the length of the inserted
  980.      text; point indicates the start of that text.  The function should
  981.      scan that text for annotations, delete them, and create the text
  982.      properties that the annotations specify.  The function should
  983.      return the updated length of the inserted text, as it stands after
  984.      those changes.  The value returned by one function becomes the
  985.      argument to the next function.
  986.  
  987.      These functions should always return with point at the beginning of
  988.      the inserted text.
  989.  
  990.      The intended use of `after-insert-file-functions' is for converting
  991.      some sort of textual annotations into actual text properties.  But
  992.      other uses may be possible.
  993.  
  994.    We invite users to write Lisp programs to store and retrieve text
  995. properties in files, using these hooks, and thus to experiment with
  996. various data formats and find good ones.  Eventually we hope users will
  997. produce good, general extensions we can install in Emacs.
  998.  
  999.    We suggest not trying to handle arbitrary Lisp objects as property
  1000. names or property values--because a program that general is probably
  1001. difficult to write, and slow.  Instead, choose a set of possible data
  1002. types that are reasonably flexible, and not too hard to encode.
  1003.  
  1004.    *Note Format Conversion::, for a related feature.
  1005.  
  1006. 
  1007. File: lispref.info,  Node: Substitution,  Next: Transposition,  Prev: Text Properties,  Up: Text
  1008.  
  1009. Substituting for a Character Code
  1010. =================================
  1011.  
  1012.    The following functions replace characters within a specified region
  1013. based on their character codes.
  1014.  
  1015.  - Function: subst-char-in-region START END OLD-CHAR NEW-CHAR &optional
  1016.           NOUNDO
  1017.      This function replaces all occurrences of the character OLD-CHAR
  1018.      with the character NEW-CHAR in the region of the current buffer
  1019.      defined by START and END.
  1020.  
  1021.      If NOUNDO is non-`nil', then `subst-char-in-region' does not
  1022.      record the change for undo and does not mark the buffer as
  1023.      modified.  This feature is used for controlling selective display
  1024.      (*note Selective Display::.).
  1025.  
  1026.      `subst-char-in-region' does not move point and returns `nil'.
  1027.  
  1028.           ---------- Buffer: foo ----------
  1029.           This is the contents of the buffer before.
  1030.           ---------- Buffer: foo ----------
  1031.           
  1032.           (subst-char-in-region 1 20 ?i ?X)
  1033.                => nil
  1034.           
  1035.           ---------- Buffer: foo ----------
  1036.           ThXs Xs the contents of the buffer before.
  1037.           ---------- Buffer: foo ----------
  1038.  
  1039.  - Function: translate-region START END TABLE
  1040.      This function applies a translation table to the characters in the
  1041.      buffer between positions START and END.
  1042.  
  1043.      The translation table TABLE is a string; `(aref TABLE OCHAR)'
  1044.      gives the translated character corresponding to OCHAR.  If the
  1045.      length of TABLE is less than 256, any characters with codes larger
  1046.      than the length of TABLE are not altered by the translation.
  1047.  
  1048.      The return value of `translate-region' is the number of characters
  1049.      that were actually changed by the translation.  This does not
  1050.      count characters that were mapped into themselves in the
  1051.      translation table.
  1052.  
  1053. 
  1054. File: lispref.info,  Node: Registers,  Next: Change Hooks,  Prev: Transposition,  Up: Text
  1055.  
  1056. Registers
  1057. =========
  1058.  
  1059.    A register is a sort of variable used in XEmacs editing that can
  1060. hold a marker, a string, a rectangle, a window configuration (of one
  1061. frame), or a frame configuration (of all frames).  Each register is
  1062. named by a single character.  All characters, including control and
  1063. meta characters (but with the exception of `C-g'), can be used to name
  1064. registers.  Thus, there are 255 possible registers.  A register is
  1065. designated in Emacs Lisp by a character that is its name.
  1066.  
  1067.    The functions in this section return unpredictable values unless
  1068. otherwise stated.
  1069.  
  1070.  - Variable: register-alist
  1071.      This variable is an alist of elements of the form `(NAME .
  1072.      CONTENTS)'.  Normally, there is one element for each XEmacs
  1073.      register that has been used.
  1074.  
  1075.      The object NAME is a character (an integer) identifying the
  1076.      register.  The object CONTENTS is a string, marker, or list
  1077.      representing the register contents.  A string represents text
  1078.      stored in the register.  A marker represents a position.  A list
  1079.      represents a rectangle; its elements are strings, one per line of
  1080.      the rectangle.
  1081.  
  1082.  - Function: get-register REG
  1083.      This function returns the contents of the register REG, or `nil'
  1084.      if it has no contents.
  1085.  
  1086.  - Function: set-register REG VALUE
  1087.      This function sets the contents of register REG to VALUE.  A
  1088.      register can be set to any value, but the other register functions
  1089.      expect only certain data types.  The return value is VALUE.
  1090.  
  1091.  - Command: view-register REG
  1092.      This command displays what is contained in register REG.
  1093.  
  1094.  - Command: insert-register REG &optional BEFOREP
  1095.      This command inserts contents of register REG into the current
  1096.      buffer.
  1097.  
  1098.      Normally, this command puts point before the inserted text, and the
  1099.      mark after it.  However, if the optional second argument BEFOREP
  1100.      is non-`nil', it puts the mark before and point after.  You can
  1101.      pass a non-`nil' second argument BEFOREP to this function
  1102.      interactively by supplying any prefix argument.
  1103.  
  1104.      If the register contains a rectangle, then the rectangle is
  1105.      inserted with its upper left corner at point.  This means that
  1106.      text is inserted in the current line and underneath it on
  1107.      successive lines.
  1108.  
  1109.      If the register contains something other than saved text (a
  1110.      string) or a rectangle (a list), currently useless things happen.
  1111.      This may be changed in the future.
  1112.  
  1113. 
  1114. File: lispref.info,  Node: Transposition,  Next: Registers,  Prev: Substitution,  Up: Text
  1115.  
  1116. Transposition of Text
  1117. =====================
  1118.  
  1119.    This subroutine is used by the transposition commands.
  1120.  
  1121.  - Function: transpose-regions START1 END1 START2 END2 &optional
  1122.           LEAVE-MARKERS
  1123.      This function exchanges two nonoverlapping portions of the buffer.
  1124.      Arguments START1 and END1 specify the bounds of one portion and
  1125.      arguments START2 and END2 specify the bounds of the other portion.
  1126.  
  1127.      Normally, `transpose-regions' relocates markers with the transposed
  1128.      text; a marker previously positioned within one of the two
  1129.      transposed portions moves along with that portion, thus remaining
  1130.      between the same two characters in their new position.  However,
  1131.      if LEAVE-MARKERS is non-`nil', `transpose-regions' does not do
  1132.      this--it leaves all markers unrelocated.
  1133.  
  1134. 
  1135. File: lispref.info,  Node: Change Hooks,  Prev: Registers,  Up: Text
  1136.  
  1137. Change Hooks
  1138. ============
  1139.  
  1140.    These hook variables let you arrange to take notice of all changes in
  1141. all buffers (or in a particular buffer, if you make them buffer-local).
  1142.  
  1143.    The functions you use in these hooks should save and restore the
  1144. match data if they do anything that uses regular expressions;
  1145. otherwise, they will interfere in bizarre ways with the editing
  1146. operations that call them.
  1147.  
  1148.    Buffer changes made while executing the following hooks don't
  1149. themselves cause any change hooks to be invoked.
  1150.  
  1151.  - Variable: before-change-functions
  1152.      This variable holds a list of a functions to call before any buffer
  1153.      modification.  Each function gets two arguments, the beginning and
  1154.      end of the region that is about to change, represented as
  1155.      integers.  The buffer that is about to change is always the
  1156.      current buffer.
  1157.  
  1158.  - Variable: after-change-functions
  1159.      This variable holds a list of a functions to call after any buffer
  1160.      modification.  Each function receives three arguments: the
  1161.      beginning and end of the region just changed, and the length of
  1162.      the text that existed before the change.  (To get the current
  1163.      length, subtract the region beginning from the region end.)  All
  1164.      three arguments are integers.  The buffer that's about to change
  1165.      is always the current buffer.
  1166.  
  1167.  - Variable: before-change-function
  1168.      This obsolete variable holds one function to call before any buffer
  1169.      modification (or `nil' for no function).  It is called just like
  1170.      the functions in `before-change-functions'.
  1171.  
  1172.  - Variable: after-change-function
  1173.      This obsolete variable holds one function to call after any buffer
  1174.      modification (or `nil' for no function).  It is called just like
  1175.      the functions in `after-change-functions'.
  1176.  
  1177.  - Variable: first-change-hook
  1178.      This variable is a normal hook that is run whenever a buffer is
  1179.      changed that was previously in the unmodified state.
  1180.  
  1181.